﻿package com.vicentediaz.view.contact
{
    import com.greensock.*;
    import com.myp.flow.*;
    import com.vicentediaz.flow.*;
    import flash.display.*;
    import flash.events.*;
    import flash.utils.*;

    public class Contact extends Sprite
    {
        private var close:ContactCloseButton;
        private var text:ContactText;
        private var flow:Flow;

        public function Contact()
        {
            this.flow = Flow.level(MainFlow.LEVEL);
            this.text = new ContactText();
            this.close = new ContactCloseButton();
            this.text.x = 45;
            this.text.y = 50;
            graphics.beginFill(0, 1);
            graphics.drawRect(0, 0, 1845, 215);
            graphics.endFill();
            this.close.x = 35;
            this.close.y = 215 - 45;
            addChild(this.text);
            addChild(this.close);
            setTimeout(this.text.showText, 500);
            TweenMax.from(this.close, 0.3, {alpha:0, delay:0.7});
            this.close.addEventListener(MouseEvent.CLICK, this.onCloseClick, false, 0, true);
            return;
        }// end function

        private function onCloseClick(param1:MouseEvent) : void
        {
            this.flow.request(MainFlow.HOME, "Contact");
            return;
        }// end function

    }
}
